//「一本通 3.1 例 2」北极通讯网络
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <cmath>
using namespace std;
const int MAXN=500;
int x[MAXN+1],y[MAXN+1];
int n,k;
struct Edge
{
   int from,to;
   double weight;
   bool operator<(const Edge other)const{
       return weight<other.weight;
   }
};
Edge edges[MAXN*MAXN+1];
struct  UFS_Node
{
    int head,last,next,size;
};
struct UFS
{
    UFS_Node ele[MAXN+1];
    void init(){
        for(int i=1;i<=n;i++) {
            ele[i].head=i;
            ele[i].last=i;
            ele[i].next=0;
            ele[i].size=1;
        }
    }
    int find_set(int x){
        return ele[x].head;
    }
    void addto(int hx,int hy){
        
        ele[ele[hx].last].next=hy;
        ele[hx].last=ele[hy].last;
        ele[hx].size+=ele[hy].size;
        while(hy>0){
            ele[hy].head=hx;
            hy=ele[hy].next;
        }
    }
    void union_set(int x,int y){
        int hx=find_set(x);
        int hy=find_set(y);
        if (hx!=hy){
            if (ele[hx].size>=ele[hy].size) addto(hx,hy);
            else addto(hy,hx);
        }
    }
};
UFS ufs;
double d;
int main(){
    cin>>n>>k;
    for(int i=1;i<=n;i++){
        cin>>x[i]>>y[i];
    }
    int m=n-k;
    if (m>0){
        int num=0;
        for(int u=1;u<=n;u++)
            for(int v=u+1;v<=n;v++){
                double w=sqrt((x[u]-x[v])*(x[u]-x[v])+(y[u]-y[v])*(y[u]-y[v]));
                edges[num++]={u,v,w};
            }
        sort(edges,edges+num);
        ufs.init();
        for(int i=0;i<num;i++){
            int x=edges[i].from;
            int y=edges[i].to;
            int hx=ufs.find_set(x);
            int hy=ufs.find_set(y);
            if (hx!=hy){
                ufs.union_set(x,y);
                m--;
                if (m==0) {
                    d=edges[i].weight;
                    break;
                }
            }
        }
    }else d=0;
    cout<<fixed<<setprecision(2)<<d;
}